using System;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace Close.io.API
{
	public class User : CloseIoUpdatedableObject
	{
		

		[JsonProperty(PropertyName = "first_name")]
		public string FirstName { get; set; }

		[JsonProperty(PropertyName = "last_name")]
		public string LastName { get; set; }


		[JsonProperty(PropertyName = "date_updated")]
		public DateTime? DateUpdated { get; set; }

		[JsonProperty(PropertyName = "email")]	
		public string Email { get; set; }

		[JsonProperty(PropertyName = "image")]
		public string Image { get; set; }

		[JsonProperty(PropertyName = "phone")]
		public string Phone { get; set; }

		[JsonProperty(PropertyName = "organizations")]
		public IEnumerable<Organization> Organizations { get; set; }

		[JsonProperty(PropertyName = "memberships")]
		public IEnumerable<Membership> Memberships { get; set; }

		[JsonProperty(PropertyName = "email_accounts")]
		public IEnumerable<UserEmailAcounts> EmailAcounts { get; set; }

		
		[JsonProperty(PropertyName = "sip_numbers")]
		public IEnumerable<SipNumbers> SipNumbersUser { get; set; }


		[JsonProperty(PropertyName = "sip_users")]
		public IEnumerable<SipUser> SipUsers { get; set; }


		public class UserEmailAcounts
		{
			[JsonProperty(PropertyName = "receive_attempts_count")]
			public int? RecieveAttemptsCount { get; set; }

			[JsonProperty(PropertyName = "user_id")]
			public string UserId { get; set; }

			[JsonProperty(PropertyName = "smtp")]
			public IEnumerable<EmailProtocol> Smtp { get; set; }


			[JsonProperty(PropertyName = "imap")]
			public IEnumerable<EmailProtocol> Imap { get; set; }

			public class EmailProtocol
			{

				[JsonProperty(PropertyName = "username")]
				public string UserName { get; set; }

				[JsonProperty(PropertyName = "user_ssl")]
				public bool? UserSSL { get; set; }

				[JsonProperty(PropertyName = "host")]
				public string Host { get; set; }

				[JsonProperty(PropertyName = "port")]
				public int? Port { get; set; }	

			}
		}


		public class SipUser
		{
			[JsonProperty(PropertyName = "date_created")]
			public DateTime? DateCreated { get; set; }


			[JsonProperty(PropertyName = "date_updated")]
			public DateTime? DateUpdated { get; set; }

			[JsonProperty(PropertyName = "username")]
			public string UserName { get; set; }

			[JsonProperty(PropertyName = "secret")]
			public string Secret { get; set; }

			[JsonProperty(PropertyName = "servername")]
			public string ServerName { get; set; }
		}

		public class SipNumbers
		{
			[JsonProperty(PropertyName = "organization_id")]
			public string OrganizationId { get; set; }


			[JsonProperty(PropertyName = "date_created")]
			public DateTime? DateCreated { get; set; }


			[JsonProperty(PropertyName = "date_updated")]
			public DateTime? DateUpdated { get; set; }

			[JsonProperty(PropertyName = "number")]
			public string Number { get; set; }

		}


	
	}
}